/*  This file is part of -_-.

    -_- is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    -_- is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with -_-.  If not, see <http://www.gnu.org/licenses/>.

    Copyright 2012-2013 Oliver Katz */

#ifndef __ARCH_MODULES_ARGBUF_H
#define __ARCH_MODULES_ARGBUF_H

#include <iostream>
#include "module.h"
#include "arch.h"

extern "C"
{
    #include "../../common/args.h"
}

//namespace sleepyface::arch::modules
namespace sleepyface
{
    namespace arch
    {
        namespace modules
        {
            //class ArgumentBuffer: a command line argument buffering module
            class ArgumentBuffer : public ArchModule
            {
            private:
                string version;
                string author;
                int year;
                z_arg_buffer abuf;

            public:
                ArgumentBuffer();
                int add(string n, char s, string v, string d, Architecture &a);
                virtual int signal(ModuleSignal s, Architecture &a);
                virtual ModuleValue get(string k0, string k1, Architecture &a);
                virtual ModuleValue set(string k0, string k1, ModuleValue v, Architecture &a);
            };
        }
    }
}

/// To create a new argument, set the value of <ARGUMENT>. To create a new argument with a shorthand, set the value of <ARGUMENT>.shorthand. To add a description, set the value of <ARGUMENT>.value. To add an initial value, set the value of <ARGUMENT>.value.
///
/// To get the value of an argument, get the value of <ARGUMENT>.value. To get whether an argument was used or not on the command line, get the value of <ARGUMENT>.flagged.

#endif
